Fixed errors shown by the static analyser