fix some compiling errors. Still more to do