You've got a couple of ways you're checking for arrays, and you probably want to favour this one.