Fixed some code analysis errors