Fix end_reached on first error bug in send_command()