Guard against empty list