Fixes for Mac build