Added shutdown to unit testing