Both general election candidates had been dogged by questionable track records.