Reverted duplicate changes to grade/lib.php.