Fix exercise code in Chapter 17