Fix saving instance state