Fixed problems with the DEBUG book and correctly implemented it.