Fixing C++ warnings