Revert "Removed obsolete test/debug code"

This reverts commit cce8d1dcd53ff56a69048fbcf0d8bcc89588636e.