Chapter 7, test updates, code cleanup