Make corrections in code so that tests succeed