Fix (?) deletion ranges provided by rearrangement API

Need proper tests but everything seems to work now.