Fixed debug logging