Index: src/scanner.c
===================================================================
--- src/scanner.c	(revision 369)
+++ src/scanner.c	(working copy)
@@ -2335,7 +2335,9 @@
 
     if (!CACHE(parser, 1)) goto error;
 
-    while (IS_ALPHA(parser->buffer)) {
+    while (!IS_BLANKZ(parser->buffer) && !CHECK(parser->buffer, ',')
+           && !CHECK(parser->buffer, '[') && !CHECK(parser->buffer, ']')
+           && !CHECK(parser->buffer, '{') && !CHECK(parser->buffer, '}')) {
         if (!READ(parser, string)) goto error;
         if (!CACHE(parser, 1)) goto error;
         length ++;
@@ -2343,18 +2345,7 @@
 
     end_mark = parser->mark;
 
-    /*
-     * Check if length of the anchor is greater than 0 and it is followed by
-     * a whitespace character or one of the indicators:
-     *
-     *      '?', ':', ',', ']', '}', '%', '@', '`'.
-     */
-
-    if (!length || !(IS_BLANKZ(parser->buffer) || CHECK(parser->buffer, '?')
-                || CHECK(parser->buffer, ':') || CHECK(parser->buffer, ',')
-                || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '}')
-                || CHECK(parser->buffer, '%') || CHECK(parser->buffer, '@')
-                || CHECK(parser->buffer, '`'))) {
+    if (!length) {
         yaml_parser_set_scanner_error(parser, type == YAML_ANCHOR_TOKEN ?
                 "while scanning an anchor" : "while scanning an alias", start_mark,
                 "did not find expected alphabetic or numeric character");
Index: src/emitter.c
===================================================================
--- src/emitter.c	(revision 369)
+++ src/emitter.c	(working copy)
@@ -1154,7 +1154,7 @@
             break;
 
         case YAML_MAPPING_START_EVENT:
-            if (!yaml_emitter_check_empty_sequence(emitter))
+            if (!yaml_emitter_check_empty_mapping(emitter))
                 return 0;
             length += emitter->anchor_data.anchor_length
                 + emitter->tag_data.handle_length
@@ -1413,10 +1413,12 @@
     }
 
     while (string.pointer != string.end) {
-        if (!IS_ALPHA(string)) {
+        if (IS_BLANKZ(string) || CHECK(string, ',')
+            || CHECK(string, '[') || CHECK(string, ']')
+            || CHECK(string, '{') || CHECK(string, '}')) {
             return yaml_emitter_set_emitter_error(emitter, alias ?
-                    "alias value must contain alphanumerical characters only" :
-                    "anchor value must contain alphanumerical characters only");
+                    "character not allowed in alias value" :
+                    "character not allowed in anchor value");
         }
         MOVE(string);
     }
