Properly limiting tags in tree menu, hiding tree menu if limit has been reached