Improved tag handling.