Fixes according to code analysis results