Fixed bug in uniform distribution