Fix bug in category validation