Changed chmod call for windows compatibility

Changed the way chmod is called, since os.Chmod works on Windows but file.Chmod does not.