Fix MacOS errors