Chapter 2 fixes

Fixed typos and minor code formatting