Use the correct variable for type detection.