Fix OS X build
Fix cppcheck on OS X
Merge pull request #297 from eile/master

Fix OS X build and cppcheck