Add guard for empty list in optimization of Sequential