Updated some dictionary entry assignment to use setattr
Changed instances of PyInt_AsLong to PyLong_AsLong