Rebase sg

This should be fixed in a deterministic way.