more MacOS compatibility fixes