Fixed minor bug in saving