Fixed a critical bug in scatter_nxm