Patch from Elle, with bits from some others, that should finally do the trick. Please everybody test this.