some python fixes involving more portals