Added type assertions for directives