transfer minor fixes from the 2.0 branch