Fixed bug in randrange