Fix error in the assignment of order - it should never be 0.