fixed #2: Changed to code to calculate next refill time in leaky buckets