fixed a few bugs in db uploads of trades