Fixing matrix transpose by correcting the copy loop.