Update haystack/query.py

Fallback for len that less than zero.