Fix bugs in Python API