Fixes to chapter 1 and 2