Fix length undefined error

I'm guessing it was supposed to be this. It wouldn't cause any problems except that the optimization to avoid `.apply()` would never get used.