Fix a bug of extension name detection.