PY: Fixed python by making relevant changes from globals branch.