rectangular matrices bug in hg alg fixed