Fixed a bug in the way saving is handled