Lots of little fixes, plus chapter 9 example.

Why this change?