Fixed bug in RandWait