Correct indexes to ignore whitespace

@mmmmmrob This ignores whitespace in the indexes and makes a more sensible decision for the last offset than the Ruby team have done IMHO :)