Improved support for very long string inputs (though still buggy)