Fixed some errors occuring on python 2.7.5