debug: fix global override

Also remove unused parts, change socket variable name and check if
message not empty

Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>