See patch.
Created attachment 3901 [details] Patch
I've checked in the patch.
*** Bug 10566 has been marked as a duplicate of this bug. ***