Merge limits patch (bug #3581)