Fix dscal bounds checking bug