Bug fixed on decoding flags