Hash index bug fixes and tests.