Var: replace ArrayDeque with LinkedList for the stack

An ArrayDeque does not accept null elements; a LinkedList does.

Fixes (the second problem raised by) issue #1.