Various hash table fixes and cleanups