Fixed an issue where a running daemon might not be detected by the daemon stop command.