Fixed another bug in one rewriter and added another test.