Fix issue where substitution ranges were ignoring the last line in the
file.