fixed many small bugs now that the broker runs in the tests