diff --git a/src/lib.rs b/src/lib.rs
index d3817f5..1cc1e16 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -369,11 +369,21 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
                 }));
             }
             '#' => {
-                values.push(toks.next().unwrap());
-                if toks.peek().unwrap().kind == '{' {
-                    values.push(toks.next().unwrap());
-                    values.extend(read_until_closing_curly_brace(toks));
-                    values.push(toks.next().unwrap());
+                let next = toks.next().unwrap();
+                values.push(next);
+                match toks.peek() {
+                    Some(Token { kind: '{', .. }) => {
+                        let next = toks.next().unwrap();
+                        values.push(next);
+                        values.extend(read_until_closing_curly_brace(toks));
+                        if let Some(tok) = toks.next() {
+                            values.push(tok);
+                        } else {
+                            return Err(("expected \"}\".", next.pos).into());
+                        }
+                    }
+                    Some(..) => {}
+                    None => return Err(("expected \"{\".", next.pos).into()),
                 }
             }
             '\\' => {
diff --git a/src/stylesheet.rs b/src/stylesheet.rs
index 540502d..6c37e86 100644
--- a/src/stylesheet.rs
+++ b/src/stylesheet.rs
@@ -298,7 +298,7 @@ impl<'a> StyleSheetParser<'a> {
                 ',' | '!' | '{' => {
                     return Err(("expected \"{\".", self.lexer.next().unwrap().pos()).into());
                 }
-                '`' => {
+                '`' | '\'' | '"' => {
                     return Err(("expected selector.", self.lexer.next().unwrap().pos()).into());
                 }
                 _ => todo!("unexpected toplevel token: {:?}", kind),
diff --git a/tests/error.rs b/tests/error.rs
index bc4fdf8..070f837 100644
--- a/tests/error.rs
+++ b/tests/error.rs
@@ -97,10 +97,7 @@ error!(
     comma_begins_value,
     "a {color:,red;}", "Error: Expected expression."
 );
-error!(
-    nothing_after_hyphen,
-    "a {-}", "Error: Expected \":\"."
-);
+error!(nothing_after_hyphen, "a {-}", "Error: Expected \":\".");
 error!(
     nothing_after_hyphen_variable,
     "a {$-", "Error: expected \":\"."
@@ -109,3 +106,20 @@ error!(
     closing_brace_after_hyphen_variable,
     "a {$-}", "Error: Expected identifier."
 );
+error!(
+    dbl_quoted_selector,
+    "\"a\" {color: red;}", "Error: expected selector."
+);
+error!(
+    sgl_quoted_selector,
+    "'a' {color: red;}", "Error: expected selector."
+);
+error!(
+    toplevel_hash_no_closing_curly_brace_has_value,
+    "#{f", "Error: expected \"}\"."
+);
+error!(
+    toplevel_hash_no_closing_curly_brace_no_value,
+    "#{", "Error: expected \"}\"."
+);
+error!(toplevel_hash, "#", "Error: expected \"{\".");