Fixed a bug with divisor calculation.