Add a close() method.