fix rewrinting tests