Bug fixes preventing code from running.
Merge pull request #231 from lemonlaug/master

Bug fixes to chapter 5 code.