Fixed crashing with older version of python