fix some static analysis errors