fixed compilation for OS X