Correct compilation errors on mac