Fix the code so that the remaining tests pass