Fixes for OS X
Merge branch 'stable'