Fixed flag parsing with bitwise and