Fixed empty gist language bug and some preparations for Python 3 support