After some time she gave birth to a most lovely little girl , and when she was well again the fairy gave her a good lecture on her past life , made her promise to behave better in future , and sent her back to the king , her husband .