Fix two bugs.

The previous fix doesn't work and a new bug found in vma_node_do_sampling
has been fixed.