added more rigerous tests for type checker, fixed bugs in Definition code