Fix getting of character at index