some fixes to Petsc ccalls