Candidate patch for issue #210

So, I didn't add a test, and I wonder if `type` should be consulted, but I also think it's probably fine to just pass a bytes object to the debug callback.