Fixes for Mac support