fixes and tests for CSV decoder