Bug fixes to recent type-checking additions