Backport kaminari fixes