Fixed bug with no flag set; Moved last flag icon to template