SimpleBroker::run() refactoring and bug fixes.