Tweaks to save output with prefixes, revert to safer handling of continuous/discrete detection in CSV files.