Ensure we handle malformed CSV files

Some additional error handling for badly formed CSV files.