Bug 21511: (RM follow-up) Use orders.count instead of new variable