Writing to file now works fine.