Fixes to correct behavior for checkKeys after refactoring