Fixes for Mac OS X
Merge branch 'dev'