Changed ofstream initialisation to be compatible cross platform