Fix indexcounters and globallock in 2.2 and 2.4 version