I added some corrections to png_writer