Removed some useless variable assignments
Fixed potential crash with uninitialized variables
Merge pull request #2659 from swisspol/static_analysis

Fixed the most obvious Clang static analyzer warnings