Use identity matrix if inertia-derived rotation is invalid.

Closes #770.