fix afterStart module bug and clean test cases and add coverage

Change-Id: I5b27e248ea96b043f48ba717ca1829fdfcd28381