Improve clearUnused.