Handle case where listener receives an empty string

Take 2.

This handles the problem I was describing in email the other day. I'm seeing the listener function receive an empty QUERY_STRING at times which blows things up downstream.