Change how selected tags are cleared.
Revert "Remove unused clear_tags function."

This reverts commit 12ee83513c8fc2c9d9ff866996feb720e4dd633f.