Adding a few more fixes from codan code analysis