Fixes to chapter 6