Shell refactoring.
Ack trade bug fix.