Fix cppCheck issues