Bug with rewriteOf sorted: looping or transitive rewrites are now taken
care of.