LinkedList test cases and a few associated fixes