Fix time.After leak

And fix config test cases.