Change permissions when opening file on windows, fixed typo when seeking from file start