Fixed OS X compilation errors