Make rate limit refreshing more robust