re #6992 more style level fixes, and a bug fix
Merge branch 'feature/6992_cppcheck' into develop