Fixes for loading/restoring database key.