Some more descriptive debug messages and code cleanup