Committed to trunk a patch that stops the crash.

Keeping open since I think this demo still points
to code errors.