This applies to the first one. I changed emacs-substitute-sexps to emacs-substitute-variables.