Fix categories bugs