Fixed compilation problems from last merge from next into sam_alt.
Merge branch 'sam_alt' into sam_alt_snap