Python support fixes