fix the handling of FlagBits in the parser and add the test from the Perl version test-suite that actually tests the handling of the FlagBits parameter