Fixed text paste bug.
Added some failing formatting tests.