Added test for empty list handling.