beautiful sam synthesis
check sam's constructor
be more defensive in looking for sam
test cases from #2650
wip