Fix for whitespace in category names in splits

Must remember to write a test when I have time.