Bug 879076: handle case of nearby keys correctly