Fix up substring