Refactor code to restore dump when value is on top-of-stack.