Fix bug with keys()
Merge branch 'keys_bug'