Fixes for 64-bit PETSc.
Merge branch 'garth/merge-fix-119' into next