Minor fixes in the code

Thanks for the book!