Cleanup classes and debug output

Fix for #20