Multiple fixes and test cases for the virtualenv module