Solving multiple C++ warnings