Revert "Fix bug that could result in infinite loops when exporting."

This reverts commit 46fe8c68451c4fa73af7410e10820148a7668d38.