Removing undefined variable  and simplifying the debug logic
Merge pull request #8 from erdeszt/master

Fixing a bug when debug is enabled