Fix distortion when divisor>2 and remove dead code.