small updates in typecheck.py