Wrong is_array check

Gives error when not an array.