test what happens at_exit - fixes #9