Fixes in ref. parsing and cleaning at CSV export