Verify if toArray is a function
Merged latest changes