Fixed bug in RandWait
Simplifaction of API