Added handling for empty/bad tag names