fix rare divide by 0.0

and remove debugging code