BUG CSV: fix problem with trailing whitespace, issues 8661, 8679