Fix a bug when using Python2.6