Improve TestClose