Save changed files correctly