Activated debug messages and fixed a related bug.