The LIMIT on query was broken; fix