Broker tests and fixes for topic state