Corrected add_to_line bug