MDL-40987, adding more unittest to repaginate and fixing the bug