Fix extension detection.