Fixed some possible bugs with flag strings