Fixing bug in the linked list implementation.