Merge pull request #321 from eile/master

Fix OS X build
Fix clang build
Merge pull request #322 from tribal-tec/master

Fix clang build