Check for nans in the weights too,
Added MPI version.
Revert from local testing settings.