Some python fixes