fix some findings by the static analyser
Merge pull request #483 from mehlis/master

fix some findings by the static analyser