Stephan Herrmann's fix for bug 420894.