Fixed build for OS X and CMake 3
Added some compiler warnings