applied 3.0 fixes to 2.5