MacOS bug fixes