Bugfix for "IndexError: string index out of range"