Improvements to python toolkit