Refined test to reduce shell loop overhead for unnecessary E matrix.
Removed unnecessary attempt to optimise cse.
Fixes sm representation.