Fixed some compilation errors on osx