Slight code reorganization in endline.