Bugs in csv inv writer