Fix highlighting at the very beginning and end.