Provide close callback
Add force-exit flag
update test to work with latest pull request