Return type checks and casts