Making sure that 'flags' is a list