fix some issues related to directives