Restores keychain properly