Add support for explicit teardown functions.