Fix compilation problems on Mac