Fixed bug in directive.