VM script updated for email; minor bug fixes