Random generator fix