Fix to handle changed behaviour of bag()