Some changes for better integration with python