fix irregular write size issue reported in #34