Removed the hardcoded query limit and turned it into a setting.