Ignore IOError in method flush(). Should fix issue #10.