Fixed an off-by-one error in substring.EndsWith.