Remove order dependency on sharing and aliasing.

Currently you have to alias before sharing; the patch removes that requirement, so that you can alias after sharing.