fix some warnings and compilation errors