Fix python bugs.