Fix ordering issue with categories