Fixes to allow installing in a virtualenv