Fix some type consistency issues