Additions to typecheck