fix building issues on OS X