Fixes in saving files