Fixed a bug with an orphaned closing div tag