Fix beam with rests crash