model-helper: handle arrays with undefined items

Follow-up for #17.

/to @raymondfeng please review