Fix tag creation bug