ws: Fix problems that coverity detected
daemon: Fix problems that coverity detected