Python support improvements