Fix category sorting