Fix onBefore/After save for categories