Restores Python2.6 and Python3 compatibility