Fixed Python compatibility