This ports fix from r46584 to the 4.1. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 46806