diff --git a/ChangeLog b/ChangeLog
index 6870d51878e6b9f55bc3fab83f414a83762640e0..88e6b45ec010b75fa6c99c618a6a3e79084a22b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
 
+2009-05-16 19:37 Ali aliov@xfce.org 
+	 * : Handle wrong battery information data
+
 2009-05-16 19:06 Ali aliov@xfce.org 
 	 * : Open settings dialog when tray icon is clicked
 
diff --git a/libxfpm/hal-battery.c b/libxfpm/hal-battery.c
index c6351125a201e5a2d73414d9ed4a5af4ac46f7a2..2e293e4c1a0b2052f70646f7fbb316b5f7b4331d 100644
--- a/libxfpm/hal-battery.c
+++ b/libxfpm/hal-battery.c
@@ -386,11 +386,20 @@ _get_battery_percentage (guint32 last_full, guint32 current)
     guint val = 100;
     float f;
     
-    if ( last_full <= current ) return val;
-    
+    if ( G_UNLIKELY (last_full <= current) ) return val;
+    
+    /*
+     * Special case when we get 0 as last full
+     * this happens for me once i had the battery
+     * totally empty on my aspire one.
+     */
+    if ( G_UNLIKELY (last_full == 0 ) )
+	return 0;
+	
     f = (float)current/last_full *100;
 	
 	val = (guint)f;
+	
     return val;   
 }
 
diff --git a/libxfpm/xfpm-notify.c b/libxfpm/xfpm-notify.c
index 5e28b8b9f71517f9c83522d53927f4d5ee7871b2..6d5a1363a3ddc424375039c3e0fd023dd30fb876 100644
--- a/libxfpm/xfpm-notify.c
+++ b/libxfpm/xfpm-notify.c
@@ -260,3 +260,10 @@ void xfpm_notify_close_critical (XfpmNotify *notify)
     if ( n )
 	g_object_unref (n);
 }
+
+void xfpm_notify_close_normal  (XfpmNotify *notify)
+{
+    g_return_if_fail (XFPM_IS_NOTIFY (notify));
+    
+    xfpm_notify_close_notification (notify);
+}
diff --git a/libxfpm/xfpm-notify.h b/libxfpm/xfpm-notify.h
index 84b21fed54c9992e75941fa7c33f3e25a78f12ec..5d519ffa6a1f2969f5553397e12644c6a578e6aa 100644
--- a/libxfpm/xfpm-notify.h
+++ b/libxfpm/xfpm-notify.h
@@ -90,6 +90,9 @@ void                      xfpm_notify_critical                      (XfpmNotify
 								     NotifyNotification *n);
 
 void                      xfpm_notify_close_critical                (XfpmNotify *notify);
+
+void			  xfpm_notify_close_normal		    (XfpmNotify *notify);
+
 G_END_DECLS
 
 #endif /* __XFPM_NOTIFY_H */
diff --git a/settings/xfpm-settings.glade b/settings/xfpm-settings.glade
index f2adba7564626ccf644df8b38f5fb4f25bb2795b..934d6eaa8b505cc30e9489a2fc141e05f5ff330a 100644
--- a/settings/xfpm-settings.glade
+++ b/settings/xfpm-settings.glade
@@ -360,6 +360,7 @@
                                             </child>
                                           </widget>
                                           <packing>
+                                            <property name="expand">False</property>
                                             <property name="position">1</property>
                                           </packing>
                                         </child>
diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c
index 412be75b16957d880e3a6fb9ce0b15c43275f970..3cfcbbe12aa3f4f078f020e06b701cd98ed66840 100644
--- a/src/xfpm-battery.c
+++ b/src/xfpm-battery.c
@@ -273,7 +273,13 @@ xfpm_battery_get_battery_state (XfpmBatteryState *state,
 				guint percentage,
 				guint8 critical_level)
 {
-    if ( !is_charging && !is_discharging && last_full == current_charge )
+    if ( G_UNLIKELY (current_charge == 0 || percentage == 0) )
+    {
+	*state = BATTERY_CHARGE_CRITICAL;
+	return _("is empty");
+    }
+    
+    if ( !is_charging && !is_discharging &&  current_charge >= last_full )
     {
 	*state = BATTERY_FULLY_CHARGED;
 	return _("is fully charged");
@@ -322,8 +328,11 @@ xfpm_battery_refresh_common (XfpmBattery *battery, guint percentage, XfpmBattery
 	battery->priv->state = state;
 	TRACE("Emitting signal battery state changed");
 	g_signal_emit (G_OBJECT(battery), signals[BATTERY_STATE_CHANGED], 0, state);
+	
 	if ( battery->priv->state != BATTERY_NOT_FULLY_CHARGED )
 	    xfpm_battery_notify (battery);
+	else
+	    xfpm_notify_close_normal (battery->priv->notify);
     }
 }
 
@@ -451,7 +460,15 @@ xfpm_battery_refresh (XfpmBattery *battery)
 		  "current-charge", &current_charge,
 		  "time", &time_per,
 		  NULL);
-    
+		  
+    TRACE ("Battery status is_present %s is_charging %s is_discharging %s", 
+	   xfpm_bool_to_string (is_present), 
+	   xfpm_bool_to_string (is_charging), 
+	   xfpm_bool_to_string (is_discharging));
+	   
+    TRACE ("Battery info precentage %i last_full %i current_charge %i time_per %i",
+	   percentage, last_full, current_charge, time_per);
+	   
     battery->priv->type == HAL_DEVICE_TYPE_PRIMARY ?
 			   xfpm_battery_refresh_primary (battery, is_present, 
 							 is_charging, is_discharging,