Fix category registration bugs