Fix a potential divide by zero timing issue
More local variables