Require that there is a valid layout with a valid number of channels before accepting nb_elems. The value is required when flushing. Thanks to kasper93 for figuring it out.