Fixed bug in the orders.

If the bug was hit in the past, an exception would have been raised.