Fix exception getting pending_hours

If we have no machines available we get a
division by zero exception