Fix random size check