Improved the long message split logic.