fixing some div by zero errors