Fix endless loop in broken files