Some more fixes and cleanup for python environment