merging with auto-paging branch and adapting to fix MULE-6991