Move over patch from Bernd Schmidt from GC branch: