Fixed some VM bugs.