Implemented close(), closeDefault() and closeAll() methods. Also fixed potential ConcurrentModificationException in destroyAll().