Fix gradient direction