Check for empty array/object values (oops!)

Well, that was embarrassing - my rewrite wasn't quite as clever as
I thought!

This fix drops peak throughput, but it's still better than it was.