Added a flag selection field

Implemented a field which stores a bitfield into int values.
(Repaired also a few examples)