fix some obvious bugs in stencil, but it still fails