fix non-uniform sampling bug in randint function