Fix segfault in index iteration for hash key val