Applied patch from Stefan Bühler from ticket #10721