Fixed build on OS X which was broken
Fixed compilation warnings on OS X