Added assertions on router helpers, and also agent handler.
Closes issue #159