Fix segfault if http/telnet port is not available