Fix frame counter and stats