Fix sort dataset plugin if dataset lengths are different