Flags fix found by Stuart Midgley