Safely handle invalid categories
Handle categories a little smoother