Fix delta and length parsing + add test for it.