Fix up global in view test
Check typeof length instead of instanceof