Tweaks on directive. Bug in function definitions in link