Fixed the type checking.