Ref counting fix.

Putting plugins in charge of deleting function arguments.