Fix by @CorgiDude for unicode errors on python 2