Removes unused code in debug_tags and improves comments