Enhance stop to support more events
Automatically rewritten for npm.