small typechecker related fixes