Fix TypeDef error in history panel by adding sanity check for tags/annotations being open (Thanks, Aysam)