Fixed some C warnings
Added CMake build.