Bugfix/router csv error

Fixes issue #618. See commit message for a detailed explanation of the fix.