Simplify testing for instantiation errors when compiling some directives