fixed up small errors in directive.js