fixed a couple bugs in factor calcs.