removed undefined stack entry

Added a FindKeySlot fail test
Some minor refactorations