Tweaks in the python code.