Rewrite apply-delta.  Also use bodec properly.