some bug fixes. Not done with markets yet.

Signed-off-by: FellowTraveler <F3llowTraveler@gmail.com>