Corrections to trade.py