Rebase g2-common over cm-12.0 with a few adjustments