On twisted character sums