Update nEndInvalid if it was COMPLETE_STRING

Change-Id: I850c9083230f44daa722e7f51dbfa73efd088d25