Added Debug Printouts and Misc Fixes