Autotrade Allocation

Fixed autotrade allocation
Also fixed some other minor issues