Added key storage and saving.