Fixed two bugs

- when processor order is row_major
- when number of processors is unequal among dimensions