Reduced infinite looping in DRLG code and reformatted files