--- userpoints.old.module	2007-08-27 19:28:58.000000000 -0600
+++ userpoints.new.module	2007-12-31 18:01:55.448875000 -0700
@@ -303,12 +303,13 @@ function userpoints_userpointsapi($op, $
 
   // Calculate the current point
   $current_points = (int)$points + userpoints_get_current_points($uid);
+  $max_points = db_result(db_query('SELECT max_points FROM {userpoints} WHERE uid = %d', $uid));
 
   // Check if user has earned points
   if ($points > 0) {
     // Set the max_points to be the current max points, plus whatever earned in this transaction
     $max_points = db_result(db_query('SELECT max_points FROM {userpoints} WHERE uid = %d', $uid));
-    $max_points = $current_points + (int)$max_points;
+    $max_points = $points + (int)$max_points;
   }
 
   drupal_set_message(t('User %uname %op %pointsvalue !points! Total now is %total points.',
