fixing a bunch of compilation errors