Fixed error in shuffle(..) for matrices