These two aetiological oddments are both generally found in the field of paediatric cardiology.
In the womb
Because the lungs aren't used in the foetus (which gets all its oxygen through the umbilicus), the heart doesn't really needed to send much blood there. So there is this little hole, called the foramen ovale, linking the right atrium to the left, allowing blood to pump through from right to left. Since little blood comes back from the lungs, pressure in the left atrium is low, and is high in the right atrium, so it keeps the flap of skin that can cover the hole open.
There is also a join between the pulmonary artery and the descending aorta, called the ductus arteriosis. This again allows the blood that would usually go to the lungs to go to the rest of the body, which needs it more.
As soon as the baby takes its first breaths, loads more blood comes back from the lungs, raising left atrial pressure. This causes the flap to slam shut, and creates the same heart circulation as is seen in adults.
Over the next few hours/days, the ductus arteriosis closes up too, creating the standard circulation.
When it goes wrong
In about 30% of people, the foramen doesn't close properly. Usually the only side effect of this is that the person is more likely to suffer from migraine. Sometimes surgery is needed to cure this.
Again, the ductus arteriosis can fail to close. This is more serious however, since the higher pressure in the aorta than the pulmonary artery means that there is a left-to-right shunt, and the child can suffer from laboured breathing and failure to thrive. There is also an high possibility of congestive heart failure if the patent duct is not closed surgically.
In some congenital conditions such as Transposition of the Great Arteries, or Tetralogy of Fallot, the abnormalities are such that if the normal closure of these ducts takes place, the baby suddenly has great difficulties, or dies. In these cases it is referred to as a duct dependant circulation; if the ducts close, the blood no longer circulates to all parts of the body adequately.