Fix compile errors on MacOSX, refs ticket #13 @30m