Be careful when cutting and pasting methods from one script into another.
I don't see any evidence that the virtWhatFile is being protected and restored when you are done with it.
If you are going to use this technique, you have to guarantee that the virtWhatFile is restored to its original condition after the test/script is done.