The second time is the charm with Nanny McPhee Returns, a sequel that improves on the original 2005 Nanny McPhee by more than a nose — even if it’s the bulbous nose of Nanny McPhee herself.

Based on Christianna Brand’s Nurse Matilda books and brought to the screen by writer and star Emma Thompson, the Nanny McPhee films relate the exploits of a magical but alarming-looking nanny — sort of Mary Poppins by way of Roald Dahl — who methodically teaches out-of-control children five significant lessons, such as saying thank you and doing what they’re told.

Unfortunately, the first film suffered in the second half with a misconceived subplot involving a widowed father’s second marriage that left him passive and unsympathetic, and just didn’t work. Nanny McPhee Returns is a more graceful and likable movie that delivers old-fashioned family entertainment with some real heart and moral substance, as well as a lot of typically British low humor.

Sporting an English accent startlingly close to Thompson’s own, American actress Maggie Gyllenhaal (Crazy Heart, The Dark Knight) plays Isabel Green, a harried farm wife and mother of three high-spirited children (Asa Butterfield, Lil Woods and Oscar Steer). (Actually, it seems that Gyllenhaal’s accent is modeled on director Susanna White, not Thompson.) Isabel is trying to hold together life on the family farm while the children’s father is off at war (seemingly World War II, though the movie avoids specifics). Further complicating things, the children’s posh city cousins, Cyril and Celia Gray (Eros Vlahos and Rosie Taylor-Ritson), are coming to the farm, ostensibly because of the danger of bombing.

Then there’s Isabel’s unscrupulous brother-in-law Uncle Phil (Rhys Ifans, Notting Hill), who’s harassing her in his brother’s absence to sell the farm. Unbeknownst to Isabel, Phil needs the money to settle a gambling debt and escape the menace of a couple of overripe hit women (Sinead Matthews and Katy Brand) who want to remove his kidneys on behalf of their employer, Mrs. Big. (Perhaps Mr. Big and the male hit men are all at war? Uncle Phil explicitly references the condition that excused him from serving.)

All of this is played with the broad comedy of old-school live-action Disney; I was alternately reminded of the likes of Mary Poppins, Bedknobs and Broomsticks and Blackbeard’s Ghost. It is almost defiantly old-fashioned. There is something charming about the idea that children will still go for this sort of thing.

Of course we know that the city kids will be spoiled rotters who look down on their country cousins, leading to further chaos. Of course Nanny McPhee will whip the kids into shape, while Uncle Phil runs interference on a too-easy happy ending.

But the movie delivers pleasures along with the formulas. The Green farm itself (notwithstanding ankle-deep mud) and the surrounding countryside is a pastoral delight — the best such setting in any family film since the original Babe. The moment when Isabel starts to suspect that the person she needs is Nanny McPhee is spookily charming. Among a solid supporting cast that includes Maggie Smith and Ralph Fiennes, Bill Bailey is a standout as a colorful farmer in the market for some pigs, one who enjoys a good story (and is willing to reward one).

Meanwhile, Nanny’s magical wit and her Dantean knack for making the punishment fit the crime continue to serve her well. My favorite conceit involves Nanny’s response to the children’s defiant refusal to share beds with one another: It’s like Han Solo’s response to Princess Leia when she says she’d just as soon kiss a Wookiee (“I can arrange that”). It’s the comic timing of this sequence, in which the children’s mother must never notice anything out of the ordinary, that makes it work. That and the baby elephant.

There are emotional edges. Not only are the three Green children — Vincent, Norman and Megsie — dealing with the absence of their father, Cyril and Celia have their own troubles on the home front, and not every crisis is neatly wrapped up when the credits roll. Here is a family film that knows that family starts with a mother and a father and that children need both of their parents together — though they don’t always get them, alas. One of the film’s best scenes is simply a confrontation between a grown-up and a child with no magical effects other than ragged emotion.

One bit of potential heartache develops in a way that I’m not entirely comfortable with. A character is reported as having been killed as a result of the war. And one of the children refuses to accept this, claiming that he can feel it in his bones that the other character is still alive. This is repeated over and over, until there is no very satisfactory solution. Some young viewers of this film will have parents overseas in war; some of these parents have died, or will die; some of their children may have a hard time accepting this. Should a film reward a child’s refusal to accept seemingly reliable testimony of a parent’s death? I don’t object to a subplot in which a character is thought to be dead but isn’t, or thought to be alive but isn’t, for that matter. I just wish there had been more to go on initially than a feeling in one’s bones.

Nanny McPhee has a foil this time out, a gaseous computer-animated raven called Mr. Edelweiss, about whom I have little to say, except that he’s no Dick Van Dyke. Mr. Edelweiss has a weakness for eating things that make him belch, which he does frequently. There are a lot of poo jokes, given the farm setting, including a particularly gross one in which a dotty old lady mistakes a cow pie for a cushion.

Why does this seem more acceptable to me in a British film than in an American one? Perhaps it’s because American filmmakers only do it in family films, whereas the British fondness for low humor extends to films for grown-ups. Still, Nanny McPhee Returns is surely the first film in history to eke such climactic significance from a body-function gag. Not all firsts are good things.

But then the real climax is the emotional one that follows, and it’s here that Nanny McPhee Returns seals the deal, making Nanny’s inevitable departure not an anticlimax, but an unexpectedly gratifying pro-family moment. There’s a bit of movie magic Hollywood family-film directors should study.