diff --git a/loopy/__init__.py b/loopy/__init__.py
index 6a68748731a0d62c444c6f8865ecb989374374e3..2a619adccb102f1b120d8a8e4ee394446389c694 100644
--- a/loopy/__init__.py
+++ b/loopy/__init__.py
@@ -108,12 +108,31 @@ def make_kernel(*args, **kwargs):
     # }}}
 
     for insn in knl.instructions:
+        # {{{ sanity checking
+
+        if not set(insn.forced_iname_deps) <= knl.all_inames():
+            raise ValueError("In instruction '%s': "
+                    "cannot force dependency on inames '%s'--"
+                    "they don't exist" % (
+                        insn.id,
+                        ",".join(
+                            set(insn.forced_iname_deps)-knl.all_inames())))
+
+        # }}}
+
         # {{{ iname duplication
 
         if insn.duplicate_inames_and_tags:
-
             insn_dup_iname_to_tag = dict(insn.duplicate_inames_and_tags)
 
+            if not set(insn_dup_iname_to_tag.keys()) <= knl.all_inames():
+                raise ValueError("In instruction '%s': "
+                        "cannot duplicate inames '%s'--"
+                        "they don't exist" % (
+                            insn.id,
+                            ",".join(
+                                set(insn_dup_iname_to_tag.keys())-knl.all_inames())))
+
             # {{{ duplicate non-reduction inames
 
             reduction_inames = insn.reduction_inames()
diff --git a/loopy/cse.py b/loopy/cse.py
index f0a0b0f3bca2699bd154f5d7b92eb7a976840779..d6af30b42a3ac954d1639aad0a8b2b7c564b604d 100644
--- a/loopy/cse.py
+++ b/loopy/cse.py
@@ -341,9 +341,12 @@ def realize_cse(kernel, cse_tag, dtype, independent_inames=[],
     """
 
     if not set(independent_inames) <= kernel.all_inames():
-        raise ValueError("cannot make iname '%s' independent--"
-                "they don't already exist" % ",".join(
-                    set(independent_inames)-kernel.all_inames()))
+        raise ValueError("In CSE realization for '%s': "
+                "cannot make inames '%s' independent--"
+                "they don't already exist" % (
+                    cse_tag,
+                    ",".join(
+                        set(independent_inames)-kernel.all_inames())))
 
     # {{{ process parallel_inames and ind_iname_to_tag arguments