Forward patch of fix for bug #369