Fixed stencil compile bug