Merge "Clean up instance checks and casts"