Fixes #7568. Follow-up fix for #5862. Objects with a length property weren't serializ...