Re #10577 Fixing compiler warnings and cppcheck error