Fix for the 1D-scan-gradient bug