Fixed problems in debug code because I did not compile