Fix tags format validation and add specs for it.