Fixed all issues by code analysis.