diff --git a/admin/upgradesettings.php b/admin/upgradesettings.php
index <HASH>..<HASH> 100644
--- a/admin/upgradesettings.php
+++ b/admin/upgradesettings.php
@@ -63,6 +63,7 @@ echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
 echo '<fieldset>';
 echo '<div class="clearer"><!-- --></div>';
 echo $newsettingshtml;
+echo '</fieldset>';
 echo '<div class="form-buttons"><input class="form-submit" type="submit" value="' . get_string('savechanges','admin') . '" /></div>';
 echo '</form>';
 
diff --git a/lib/adminlib.php b/lib/adminlib.php
index <HASH>..<HASH> 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -2356,7 +2356,7 @@ class admin_setting_special_gradebookroles extends admin_setting {
             $first = true;
             foreach ($roles as $roleid=>$role) {
                 if (is_array($currentsetting) && in_array($roleid, array_keys($currentsetting))) {
-                    $checked = 'checked="checked"';
+                    $checked = ' checked="checked"';
                 } else {
                     $checked = '';
                 }
Fixes MDL-<I> "XML well-formed bug, need space before 'checked' attribute." (Merged from MOODLE_<I>_GROUPS)