This needs more work on the broker front to simplify the design.
Add test to check for invalid values.