call CreateUnitMatrix[] only when needed

Reason: CreateUnitMatrix[] might return an error for some types.
version 1.0.1-cpc3