Strip query string before checking emptiness.