patch by <zooba at aanet dot com dot au> See issue #3400 for more details. svn path=/trunk/; revision=38930