debug message improvements