Fix exception when attaching to running VM