Add a cleanup handler

Fixes #2