Format code and fix MPI3 problems