Fixed bugs for class positions