Index: lib/HTML/Widget/Element.pm
===================================================================
--- lib/HTML/Widget/Element.pm	(revision 31)
+++ lib/HTML/Widget/Element.pm	(working copy)
@@ -148,7 +148,7 @@
 
 sub mk_label {
     my ( $self, $w, $name, $comment, $errors ) = @_;
-    return undef unless $name;
+    return undef unless defined $name;
     my $for = $self->attributes->{id} || $self->id($w);
     my $id  = $for . '_label';
     my $e   = HTML::Element->new( 'label', for => $for, id => $id );
Index: lib/HTML/Widget/Element/RadioGroup.pm
===================================================================
--- lib/HTML/Widget/Element/RadioGroup.pm	(revision 31)
+++ lib/HTML/Widget/Element/RadioGroup.pm	(working copy)
@@ -86,7 +86,7 @@
     }
     
     my %seen;
-    my @uniq = grep { $seen{$_}++ == 0 ? $_ : 0 } @{ $self->values };
+    my @uniq = grep { ! $seen{$_} ++ } @{ $self->values };    
     
     $w->constraint( 'In', $name )->in( @uniq )
         if @uniq;
Index: lib/HTML/Widget/Element/Select.pm
===================================================================
--- lib/HTML/Widget/Element/Select.pm	(revision 31)
+++ lib/HTML/Widget/Element/Select.pm	(working copy)
@@ -87,7 +87,7 @@
     
     my %options = @{ $self->options } if (ref $self->options);
     my %seen;
-    my @uniq = grep { $seen{$_}++ == 0 ? $_ : 0 } keys %options;
+    my @uniq = grep { ! $seen{$_} ++ } keys %options;
     
     $w->constraint( 'In', $name )->in( @uniq )
         if @uniq;
Index: t/element_radiogroup_implicit_in_constraint.t
===================================================================
--- t/element_radiogroup_implicit_in_constraint.t	(revision 31)
+++ t/element_radiogroup_implicit_in_constraint.t	(working copy)
@@ -1,4 +1,4 @@
-use Test::More tests => 5;
+use Test::More tests => 8;
 
 use_ok('HTML::Widget');
 
@@ -7,7 +7,7 @@
 
 my $w = HTML::Widget->new;
 
-$w->element( 'RadioGroup', 'foo' )->values([ 1, 2 ]);
+$w->element( 'RadioGroup', 'foo' )->values([ 0, 1, 2 ]);
 $w->element( 'RadioGroup', 'bar' )->values([ 3, 4 ]);
 
 
@@ -17,13 +17,18 @@
 
     my $f = $w->process($query);
 
+    my @constraints = $w->get_constraints;
+    cmp_ok(scalar(@constraints), '==', 2, 'Two implicit IN constraints');
+    cmp_ok(scalar(@{$constraints[0]->_in()}), '==', 3, 'Three keys for constraint 0');
+    cmp_ok(scalar(@{$constraints[1]->_in()}), '==', 2, 'Two keys for constraint 1');
+
     ok( $f->valid('foo') );
     ok( ! $f->valid('bar') );
     
     ok( $f->has_errors( 'bar' ) );
 
     is( "$f", <<EOF, 'XML output is filled out form' );
-<form id="widget" method="post"><fieldset><span><label for="widget_foo_1" id="widget_foo_1_label"><input checked="checked" class="radio" id="widget_foo_1" name="foo" type="radio" value="1" />1</label><label for="widget_foo_2" id="widget_foo_2_label"><input class="radio" id="widget_foo_2" name="foo" type="radio" value="2" />2</label></span><span><label for="widget_bar_1" id="widget_bar_1_label"><input class="radio" id="widget_bar_1" name="bar" type="radio" value="3" />3</label><label for="widget_bar_2" id="widget_bar_2_label"><input class="radio" id="widget_bar_2" name="bar" type="radio" value="4" />4</label></span><span class="error_messages" id="widget_bar_errors"><span class="in_errors" id="widget_bar_error_in">Invalid Input</span></span></fieldset></form>
+<form id="widget" method="post"><fieldset><span><label for="widget_foo_1" id="widget_foo_1_label"><input class="radio" id="widget_foo_1" name="foo" type="radio" value="0" />0</label><label for="widget_foo_2" id="widget_foo_2_label"><input checked="checked" class="radio" id="widget_foo_2" name="foo" type="radio" value="1" />1</label><label for="widget_foo_3" id="widget_foo_3_label"><input class="radio" id="widget_foo_3" name="foo" type="radio" value="2" />2</label></span><span><label for="widget_bar_1" id="widget_bar_1_label"><input class="radio" id="widget_bar_1" name="bar" type="radio" value="3" />3</label><label for="widget_bar_2" id="widget_bar_2_label"><input class="radio" id="widget_bar_2" name="bar" type="radio" value="4" />4</label></span><span class="error_messages" id="widget_bar_errors"><span class="in_errors" id="widget_bar_error_in">Invalid Input</span></span></fieldset></form>
 EOF
 }
 
Index: t/element_select_implicit_in_constraint.t
===================================================================
--- t/element_select_implicit_in_constraint.t	(revision 31)
+++ t/element_select_implicit_in_constraint.t	(working copy)
@@ -1,4 +1,4 @@
-use Test::More tests => 5;
+use Test::More tests => 8;
 
 use_ok('HTML::Widget');
 
@@ -8,7 +8,7 @@
 my $w = HTML::Widget->new;
 
 $w->element( 'Select', 'foo' )->label('Foo')
-  ->options( 1 => 'one', 2 => 'two' );
+  ->options( 0 => 'zero', 1 => 'one', 2 => 'two' );
 $w->element( 'Select', 'bar' )->label('Bar')
   ->options( 3 => 'three', 4 => 'four' );
 
@@ -17,13 +17,18 @@
     my $query = HTMLWidget::TestLib->mock_query({ foo => 1, bar => 1 });
 
     my $f = $w->process($query);
-    
+
+    my @constraints = $w->get_constraints;
+    cmp_ok(scalar(@constraints), '==', 2, 'Two implicit IN constraints');
+    cmp_ok(scalar(@{$constraints[0]->_in()}), '==', 3, 'Three keys for constraint 0');
+    cmp_ok(scalar(@{$constraints[1]->_in()}), '==', 2, 'Two keys for constraint 1');
+
     ok( $f->valid('foo') );
     ok( ! $f->valid('bar') );
     
     ok( $f->has_errors( 'bar' ) );
     
     is( "$f", <<EOF, 'XML output is filled out form' );
-<form id="widget" method="post"><fieldset><label for="widget_foo" id="widget_foo_label">Foo<select class="select" id="widget_foo" name="foo"><option selected="selected" value="1">one</option><option value="2">two</option></select></label><label class="labels_with_errors" for="widget_bar" id="widget_bar_label">Bar<select class="select" id="widget_bar" name="bar"><option value="3">three</option><option value="4">four</option></select></label><span class="error_messages" id="widget_bar_errors"><span class="in_errors" id="widget_bar_error_in">Invalid Input</span></span></fieldset></form>
+<form id="widget" method="post"><fieldset><label for="widget_foo" id="widget_foo_label">Foo<select class="select" id="widget_foo" name="foo"><option value="0">zero</option><option selected="selected" value="1">one</option><option value="2">two</option></select></label><label class="labels_with_errors" for="widget_bar" id="widget_bar_label">Bar<select class="select" id="widget_bar" name="bar"><option value="3">three</option><option value="4">four</option></select></label><span class="error_messages" id="widget_bar_errors"><span class="in_errors" id="widget_bar_error_in">Invalid Input</span></span></fieldset></form>
 EOF
 }
