Fix cursor pos after insert text. Fix form and remove workaround