fix code analysis errors