Fix hanging ends.