MacOS related fixes