Comment 82 for bug 741528

Created attachment 522155
fix for 1.8.1(.24)

backport to 1.8.1.24.
If anyone has time to take a look at it, I'd be very grateful