Modified to reset vm flags before loading a file.