Clean up handlers and CLI.