Refactor code for paused virtual machines
Improve error reporting