resync with 2.2.0.b9 source code