Fixed LinkedList usage related memory errors