Debug improvements