A few corrections to the python code