Refs #8962 Fixing cppcheck and gcc warnings

this should fix the cppcheck and gcc compiler warnings caused by my work on this ticket