Improve handling of badly formatted categories
Fix text for errors