Bunch of fixes for issues from SCA

Fixes for:
- prefer prefix ++operator for iterator
- use static_cast instead of C-Style cast
- initialize (some) variables in constructor
- move initialization in initialization list
- remove unused variables
- use empty() instead of size() == 0
- fix inefficient usage of string::find()
- reduce scope of some variables
- use %u to format unsigned in sprintf()
- use 'true' directly instead of variable