Static code analysis fixes