fix debug to properly work with outputBufferBits()
Merge pull request #1846 from ZappoMan/fixdebugoutput

fix debug to properly work with outputBufferBits()