Made layer.type case insensitive.