Implementing close.