[4.1] Improved Random

See #4173.