Check arguments passed to methods and publish functions. Fixes #53