Important fix (bug 337239) from Alexander Larssen. Thanks Alex!