Additional type-checking and a typo fix.