Bugfixed to run on MPI cluster