Fix hash iterator code bug when there are multiple entries in single bucket