Fix looping multiple lines of commands.