Fixed static analyser warnings