Fix bug with insertion recognition.