Fixes and simplifies linked list.