Fixes to compare_sam script