Shutdown modules cleanly

Change-Id: Ie4f5270ba58d167bcfd90e5d41bc0834a2d989a8
Merge "Shutdown modules cleanly"