backporting master changes to 2.0.0