Improved handling of CSVs and added some empty package prevention.