Fixed shutdown problem.