Correct namespace.
Wrap `invoke` in try/catch.
Merge pull request #834 from simonwheatley:fix-833