Fixed a bug where the first result of a query was skipped.