Merged in new code from the 2.3.x branch that seem like it should get merged into 3.0 as well.