Fix tag overflow, fixes #347