Add test for error message. Clean up code per exercises from end of Chapter 7.