Fixed variable not being increased properly