Fix substring starting index.