Fixed checking conditions for type "type"