patch by Giannis Adamopoulos <johnyadams at hotmail dot com> See issue #4528 for more details. svn path=/trunk/; revision=41093