Bug fixes on XML detection.