Bunch of bug fixes, mostly around virtualenv.