Fixed exercise code in Chapter 17