fixed bugs causing too many injected rules, and wrongly parsing exceptions