Fixed code analysis errors