Patch by Thomas Faber <thfabba at gmx dot de> See issue #6015 for more details. svn path=/trunk/; revision=51165