cppcheck: reduce scope of variables
cppcheck: remove unused variables
cppcheck: initialize missing member variables in constructor
fix minor comment alignment
fix switch compiler warnings reg. unhandled enum values