Use duplicate of MPI communicator, fix bugs

 - create duplicate of application MPI communicator as required by MPI
 - fix segfaults in parallel tests