Fixes for auth and admin auth
Fix sorting headers
Protect encrypted databases on restore