Trend removal in counting experiments