Added vm related functions.