Fixed a bug with selling

Before, if you sold of your items, the last of the items would be left there.
This commit fixed that bug and also some formatting things and a bad import