Fix memory leaks.
Allow captured arguments of unknown type.
Merge pull request #3 from franklefebvre/master

Everything checks out on unit tests, so the merge is good.