Fixed up a number of small errors