Fix math, remove useless code.