Fixes for Chapter 9.

Please see the commit history.