Fix EncryptKeys crash introduced by a9ba4710, identified by TD.