fixing bugs in static template encoder of csv