various fixes to export and compare