Fixing TypeError when creating gist