Improved tag query (thanks Mark)