Finish rewriting tests