Fix getting of character at index
Merge pull request #2296 from Taritsyn/master

Fix getting of character at index