I have run into this problem a couple of times. The part of the pastry that doesn't get cooked all the way is the part that is folded over. So to prevent it being under baked trim the puff pastry before folding, or even during the folds to make it a little lighter in areas. Another trick you can do is cover the entire thing in foil towards the end of baking and add an extra 10 minutes.