patch to avoid wrong join in pagination.

https://bmir-gforge.stanford.edu/gf/project/ncbo/tracker/?action=Tracker
ItemEdit&tracker_item_id=4256&start=0