Fixed possible crash

It could crash if MaxAmount - MinAmount was 0 because it would execute (Number % 0)