Fixed rebin. This resolves #7909