Remove local isArray() and simplify code.