diff --git a/firestarter b/firestarter
index 76fb179..6e92baf 100755
--- a/firestarter
+++ b/firestarter
@@ -460,20 +460,20 @@ step_postexecute() {
 }
 step_wait() {
 	[ -n "$_dryrun" ] && exit 0
-	log "Send any termination signal to firestarter to log out"
 	trap step_logout EXIT
-	if [ -n "$FS_DIEONWM" ] && gettarget "$_configdir/wm" && has readlink; then
-		target="$_return"
+	if [ -n "$FS_DIEONWM" ] && gettarget "$_configdir/wm" && has readlink && has "$_return"; then
+		target="$(command -v "$_return")"
 		for job in $(jobs -p); do
 			if [ "$target" = "$(readlink /proc/$job/exe)" ]; then
-				log "Waiting for WM to exit"
+				log "Waiting for WM to exit: \"$_return\""
 				wait "$job"
+				exit 0
 			fi
 		done
-	else
-		log "Waiting for programs to exit"
-		wait
+		log "Could not find WM: \"$target\""
 	fi
+	log "Waiting for programs to exit"
+	wait
 	exit 0
 }
 step_logout() {