BOOST_FOREACH(const Service::Ptr &service, OldServices)
     {
-        if ( ( service->get_last_updates().front() + ((time_t)service->get_update_interval()*60) ) >= current_time )  /*lint !e1793 */ // UpdateInterval timeout of service isn't expired.
+        if ( !service->get_last_updates().empty() &&
+             ( service->get_last_updates().front() + ((time_t)service->get_update_interval()*60) ) >= current_time )  /*lint !e1793 */ // UpdateInterval timeout of service isn't expired.
             service_container->add_service(service);
     }
 
 
         time_t current_time = time(NULL);
 
         // Try to get the lastupdated time of the actual service if there is one.
-        if ( service->get_last_updates().size() > 0 )
+        if ( !service->get_last_updates().empty() )
             lastupdated = service->get_last_updates().front(); /*lint !e1793 */
 
         Log->print_check_service_update(hostname, current_time, lastupdated);