Fix compiler issues on Mac