Some tag handling with tests