Fixes for Mac OS