Fix bugs when more than one directive was used