clean debug output and incompatibilities with ruby 1.8.6