Demand flags

The previous length setting (without flags) was inconsistent with the code
that does require the flags field to be present.