fix a few compilation errors and run valgrind against icfdetect