patches from Miroslav for tag editing