Corrects category id when editing