Fix saving bugs