Solving problem with internal classes

This is my fix, first commit will introduce a test to reproduce the error, the second one will be the fix for it.

Related to #59
Yes, but we have no way of knowing. Restoring the error handler that we've replaced, as I suggested, is the most safe way I think.