Fix multiple foreach in the same scope with the same identifier,
Make sequences set current to undefined when completed