Fixed bug in pagination during searches.