Fix bug in VM destruction.

Change-Id: I1bd7b966a4d1e685c03e55a5da718776b2c6893b