Fix python compatibility