[Daemon-fix][Upstream merge] Small fixes in daemon starting