Fix crash on save As on Windows (close #4)