minor changes to typecheck