Fix solution to exercise 7.45