Text insertion fixes