Proper flag parsing