Fix blackout/gap identification and sorting