Prevent div by zero in runloop