Cppcheck

Trying to reduce cppcheck warnigs