Cppcheck fixes (WIP)