De-stupid how flag setting works

If no index is given, we obviously want to set the whole flag, not part
of it.