Don't repeat typing if we don't have any text
Don't build out of empty transactions
Merge pull request #311 from atom/insert-fixes

Insert fixes