Fix compilation warnings and implement ctest