Avoid pop from empty list.