ENH: fixes for samples to build under Mac