Here are the steps that I've done:

Used DVD Fab Decrypter to rip Flight of the Conchords, Season 1, Disc 1.

Using Handbrake 0.9.4, selected "Source"->"DVD / VIDEO_TS Folder" to open the ripped DVD files.

Under "Title", I select title 1, which is the first episode. There are 9 chapters found, and I've verified that the episode has 9 chapters by playing it in VLC.

Double click on "Regular"->"High Profile" under Presets.

Changed the container from MP4 to MKV.

Under the Audio tab, there are two audio tracks, one is an AAC version of the sole audio track on the episode, and the other is the untouched (AC3 Passthru) version of the same audio track. I remove the AAC track as I only want the AC3 version.

Without changing anything else, I start encoding.

The file that is produced is 27:41 long, both in MediaInfo and in VLC. When I play the DVD in VLC, it says the episode is 27:38. When I open the DVD VOB file with the episode directly in VLC, rather than by opening the DVD and navigating through menus to play it, the duration is 27:40. MediaInfo also says the VOB file is 27:40.

What is causing these duration differences? Is there any reason I should be concerned? The difference is so small that in itself, it's not a problem, but I'm wondering if it's an indication that something else could be wrong, like dropped/extra frames, audio/video sync issues, etc.

The other, bigger problem, is that the chapters are all off by anywhere between 3 and 10 seconds. They are all behind the actual chapter mark, meaning that when I select "next chapter" in VLC, it jumps to a spot in the episode that is 3-10 seconds before the actual spot where it should jump to.

I also just noticed that the actual video is off by more than the 4 second max that I would expect based on the 27:38 vs 27:41 duration difference. A moment in the output file at 16:55 was actually at 16:45 in the DVD version.

Can anyone offer up an explanation for the duration differences?
Can anyone suggest a way to fix the chapter markings?

Thanks.