Several warnings detected by static code analyzer fixed