CSV output: features and bug fixes