Use safer isArray

`object instanceof Array` is not safe in multi-frame environments. See http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ for more information.