Merge "Avoid waiting unnecessarily if there is no data to return." into sc-dev