Fixed random range issue with list encoding