Switching from isEmptyObject to checking length

Fixes navigation issues. I guess isEmptyObject doesn't work on jQuery
objects. Which is weird.
For real this time, final steps to resolve #388
Removing debug logging.