Implement close.
clean some tests (auto export enabled by default there is no need to explicit export).