Fix exception caused by triggering save without changes