fixed compilation errors in osx