Fix random_str method