Fix error in directive regex
More fixes