fixed problem when dividing by an invalid factor.
Merge remote-tracking branch 'origin/master'