Fix a number of mistakes found by Emily.