fix building issues on Mac OS X