Fixed shutdown issue.