Some updates for linear algebra utilities

Shouldn't `var i = 0`, be right before this line?