Fix bug in list handling.