Fix serialization when store_key option used