Fix CMake build
Fix the build on Mac OS
Fix some compiler warnings from clang
Merge pull request #3 from jave27/master

Fix Mac OS build and some compiler warnings