Updated checkZIndexLevels procedure.