Fix bug discovered with address sanitizer.

Now, this works again with an empty stack.