BUG-4400: make sure we retain input ordering