Debug function simplified.