Renamed SafeSubstring param and supporting logic

SafeSubString(int) was passing a "length" parameter as a startIndex.