Fixes a bug that made m go negative when mpisize>2
Stylistic changes.