Updated flags parsing