Fixed potential bug when saving multiple times in succession.