Correct handling of carets