convert array-like objects to arrays