Fixed wronlgy returning value isntead of key in the key iterator.
Renaming soem stuff.