`type_map` returns some predefined strings or nil, never an empty string. What are you checking for, here?