Fixed a compatibility bug  with python 2.6