The correct cooking time and proper balance of flour and cornstarch are vital for the filling to set. Following the recipe's exact measurements will usually ensure a perfect set.