Fixed problem with key lookup