Fixed average function and star glitches