Added support for flags and fixed Quaggan foreground (foreground_id: 127)