Added more end to end tests and fixed some code in Order.cloneForDiscontinuing