Bug fix in getKey