Removes unused directives.