Bugfix: correctly create shutdown listener.