[1.3.2] Removed writer.flush() as it is set to automatically flush.