Allow extensions to have return values, etc.

Now fixes #637.