Fixed NaN div by 0 mistakes.