Fix random pieces generation