Fixed a bug with the categoryHash function