fixed a couple of compilation errors and warnings