Fixed initialization of setOfGaps when recovering