Added checkZIndexLevels procedure.