Fix type casts.