Fixes for chapter 5