Fixed minor shutdown issue