fix some division errors