This patch ensures that the port connection count is set to zero in those cases when the port is not connected.