Fixed bugs

Some of the matrix dimensions were mislabeled, which caused issues when
the dimensions weren't the same anymore.