fix compilation errors. Still a couple of tests to fix