This reverts commit 8f7175c9. The logic here is flawed and skips too much. It also handles NoError as error. (cherry picked from commit ab69a387)