Merge pull request #436 from TheBlueMatt/master
Fix EncryptKeys crash introduced by a9ba471, identified by TD.