Convert nsIArray to Array correctly