Minor performance optimizations to the compilation of directives