Fixed a bug that was mutating the identity matrix