     (httpd-stop))
   (dolist (buf (buffer-list))
     (with-current-buffer buf
-      (if skewer-mode (skewer-mode -1))
-      (if skewer-css-mode (skewer-css-mode -1))
-      (if skewer-html-mode (skewer-html-mode -1)))))
+      (if (bound-and-true-p skewer-mode)
+          (skewer-mode -1))
+      (if (bound-and-true-p skewer-css-mode)
+          (skewer-css-mode -1))
+      (if (bound-and-true-p skewer-html-mode)
+          (skewer-html-mode -1)))))
 
 
 ;;

  (interactive)
  (call-interactively
   (if (and (featurep 'skewer-mode)
            (or skewer-mode skewer-css-mode skewer-html-mode))
       #'skewer-repl
     #'nodejs-repl))
  (current-buffer))

    (run-skewer))
  (pcase major-mode
    ((or 'css-mode 'scss-mode 'less-css-mode)
     (unless (bound-and-true-p skewer-css-mode)
       (skewer-css-mode +1)))
    ((or 'web-mode 'html-mode)
     (unless (bound-and-true-p skewer-html-mode)
       (skewer-html-mode +1)))
    ('js2-mode
     (unless (bound-and-true-p skewer-mode)
       (skewer-mode +1)))
    (_ (error "Invalid mode %s" major-mode))))

