Tweak get_flags method to return list of names