Improve the code by static code analysis [1/3]: Bug fixes