Minor typechecking fixes