Fix gradient bug on 2.x