Fix for SNES with PETSc dev version.
Merged in garth/snes-fix (pull request #14)

Fix for SNES with PETSc dev version.