Convert iterators into arrays before mucking about with them.

$data['options'] might be an iterator. Convert it to an array before
adding empty options or converting to option elements.