Maddie could have just passed on the kid as Jack's while continuing to get her guts rearranged and filled with Danny's seed behind his back. As for the baby being part ghost that is also easy to explain. They literally work around the paranormal all the time just explain it as a side effect of an experiment she did while she didn't know she was pregnant.