Minor bug fixes for end of Chapter 4