Fix #1682
Merge pull request #1743 from bucketh3ad/debug_bug

Fix #1682