Minor refactoring (type checking methods shortened, tests added, etc).