Support for using the PetSc KSP linear solver without running under MPI

1. If you have PetSc4py installed, you can now run with petsc_ksp solver without running mpi.
2. A couple of small fixes were also included.