Fix random element selection