Katey Sagal was pregnant in real life and so it was included in the show, however in her seventh month of pregnancy she had an emergency c-section and her daughter was stillborn. So they wrote it in that Al had been dreaming the whole time.
r43871