Add new unit tests for shutdown