Fix tag parsing