Adds a isIdentityMatrix function, which was previously called
despite not existing.

Fixes #1927.