[1.2.5] Fix errors found by static code analyzers