Fixed hanging on shutdown.
Update