Opposite effects of choice history and stimulus history resolve a paradox of sequential choice bias