Fixes for MacOS