package godoc
fix bugs on shutdown
Add tests