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