MacOS compilation fixes