Fix bug in handling traces shifted outside a requested window