fix some findings by the static analyser