Add missing includes for OSX

Review 1271 by @srh
Merge branch 'next' into sam_tptest
Merge branch 'sam_tptest' into next
Merge branch 'next' into sam_alt_unittest