Line 2 of both algorithms should also include $\delta_0=0$. Thanks to Jens Liebenau for reporting the issue!