Fix bug in Exercise 8