Remove unnecessary qualification.
Fix an issue with allocation of a zero-size array.
Simplify tests.
Fix parsing of flags.