Fixed some minor bugs so that code compiles.