Fix exercise 4.2, close #495