This line is removed and the finalization test is given at the end of this function, where it is definitely needed. The function calls two PETSc assembly functions to perform a global collective operation.