New chapter on error handling plus many smaller fixes