Fixed failing graceful shutdown