Fix first-order transformation of redomap.
Fix scan first order transform.

Turned out that our sharing analysis isn't precise enough, so the
solution was to insert some more copy() calls.  So ugly...

(I can find a better way, I'm sure.)