Save file routine bug fixes