- Added missing check for chainHead.isValid() in findNullKeyEntryInChain()