stuff back ported from 2.0