Fix some typechecker errors