diff --git a/avrdude.conf.sample b/avrdude.conf.sample
index a1d9d820..f33f308b 100644
--- a/avrdude.conf.sample
+++ b/avrdude.conf.sample
@@ -422,7 +422,7 @@ part
         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
                           "x x x x  x x x x   x x x x  x x x x";
 
-        pwroff_after_write = 1;
+        pwroff_after_write = yes;
       ;
     memory "lock"
         size            = 1;
@@ -500,7 +500,7 @@ part
         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
                           "x x x x  x x x x   x x x x  x x x x";
 
-        pwroff_after_write = 1;
+        pwroff_after_write = yes;
       ;
     memory "lock"
         size            = 1;
diff --git a/config_gram.y b/config_gram.y
index e5afc493..1b0a1d7f 100644
--- a/config_gram.y
+++ b/config_gram.y
@@ -399,9 +399,9 @@ mem_spec :
       free_token($3);
     } |
 
-  K_PWROFF_AFTER_WRITE TKN_EQUAL TKN_NUMBER
+  K_PWROFF_AFTER_WRITE TKN_EQUAL yesno
     {
-      current_mem->pwroff_after_write = $3->value.number;
+      current_mem->pwroff_after_write = $3->primary == K_YES ? 1 : 0;
       free_token($3);
     } |