Fixing matrix index order problem (due to earlier transpose)