Fixed protocol and broker bugs