Fix python errors