Some cleanup in saving files.