Fixed bug in simple_writer.py