Using references for mSubTri for-each loops.
Cleanup of code (wrong code style).